package ch06;

import ch06.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestCh06Anno {

    @Test
    public void testIOC_cons(){
        String url ="application_ch06_anno.xml";
        ApplicationContext context = new ClassPathXmlApplicationContext(url);
//        UserServiceImpl userService = context.getBean("userService",UserServiceImpl.class);
        UserServiceImpl userService = context.getBean("userSevice321",UserServiceImpl.class);
        userService.add();

    }
}
